package com.ch.demo1;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class demo4 {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("河北省","山西省","吉林省","辽宁省","海南省","四川省","贵州省","云南省","北京市","天津市","上海市","重庆市");
        List<Object> collect = list.stream().filter(s -> s.endsWith("市")).map(s -> {
                    return "直辖市:" + s;
        }).collect(Collectors.toList());
        collect.forEach(System.out::println);
    }
}
